from threading import Thread 
import threading
import time
import pycato
a=pycato.pycato(0)
def add():
   global a
   a.add(1)
if __name__ == "__main__":
    numbers = [x for x in range(1000000)]
    threads = []
    start_time = time.perf_counter()
    for number in numbers:   
        thread = Thread(add())  # 实例化
        thread.start()  # 启动线程
        threads.append(thread)
    for thread in threads:
        thread.join()  # 等待线程完成，并关闭线程
    end_time = time.perf_counter()
    print(a.get(),end_time-start_time)